// tech

@mixin aui-layout-create-simple-table() {
    & {
        display: table;
        > .aui-layout__item {
            display: table-cell;
            &:first-child {
                vertical-align: top;
            }
        }
        @content;
    }
}

@mixin app-create-message-media() {
    .app-message-media {
        $self: #{&};

        > .aui-layout {
            @include aui-layout-create-simple-table() {
                width: 100%;
            }    
        }

        &__logo {
            width: 45px;
            margin-top: 3px;
        }
        &__title {
            margin-top: 0;
            margin-bottom: 0;
            font-size: 12px;
            max-width: 45%;
            display: inline-block;
            @include aui-mixin-text-one-line();
            > [app-inner] {                       
                display: inline-block;
            }
        }
        &__extend {
            font-size: 14px;
        }
        &__rowgutter {
            width: 10px;
        }
        &__gutter {
            height: 5px;
        }
        &__content {
            font-size: 12px;
            display: inline-block;
            position: relative;
            max-width: 50vw;
            > [app-inner] { 
                min-width: 5em;
                
                // 用户消息要换行                
                word-break: break-all;
                word-wrap: break-word;

                display: inline-block;
                vertical-align: top;
                padding: 10px;
            }        
            > [app-append] {
                display: inline-block;   
                position: absolute;
                bottom: 0;
            }
        }
    

        &--left {
            > .aui-layout > .aui-layout__item {
                &:first-child {
                    width: 45px;
                }
            }   
            #{$self}__extend {
                float: right;
            }
            #{$self}__content {
                > [app-inner] {                
                }
                > [app-append] {
                    padding-left: 10px;
                    right: 0;
                    transform: translateX(100%);
                }
            }
        }

        &--right {
            > .aui-layout > .aui-layout__item {
                &:nth-child(3) {
                    width: 45px;
                }
            }
            > .aui-layout > .aui-media__body {
                text-align: right;
            }            
            #{$self}__extend {
                float: left;
            }
            #{$self}__content {
                text-align: right;
                > [app-inner] {
                    text-align: left;                
                }
                > [app-append] {
                    padding-right: 10px;
                    left: 0;
                    transform: translateX(-100%);
                }
            }
        }

        @content;
    }
}